#include <stdio.h>
#define q 5 //number of quizes
#define s 5 //number of students

 void studentAverages(double qgr[][q],double avr[]);

int main (){
 
  int sid[s] ,i,j;
  double qgr[s][q], avr[s]={};
  FILE *input ;
  
  input=fopen("grades.txt ","r");
    
    for(i=0;i<s;i++){
        fscanf(input,"%d",&sid[i]);
        for(j=0,j<q,j++)
        fscanf(input,"%lf",&qgr[i][j]);
    }
    
    fclose(input);
    
    studentAverages(qgr ,avr);
    
    	printf ("\tID\tQuiz Average\n");
	for (i=0 ; i < s ; i++)
		printf ("   %d\t\t%.1lf\n",sid[i],avr[i]);
	return 0;
    
}

 void studentAverages(double qgr[][q],double avr[]){
 int i,j;
 for(i=0,i<s,i++){
    for(j=0,j<q,j++) 
        avr[i]+=qgr[i][j];
             avr[i]/=q;
 }
}
